#include "netfun.h"

NetFun::NetFun(QObject *parent) : QObject(parent)
{
    m_accessManager = new QNetworkAccessManager(this);
    QMetaObject::Connection connRet = QObject::connect(m_accessManager, SIGNAL(finished(QNetworkReply*)), this, SLOT(finishedSlot(QNetworkReply*)));
    Q_ASSERT(connRet);
}

void NetFun::sendPost(QString sendStr)
{
    QNetworkRequest request;
    request.setUrl(QUrl("http://82.157.165.4:9000/index/save/"));
    request.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("application/json;charset=UTF-8"));
    QNetworkReply* reply = m_accessManager->post(request, sendStr.toUtf8());
}
void NetFun::finishedSlot(QNetworkReply *)
{
    return;
}
